<!--
 * @Date: 2020-01-06 09:28:29
 * @LastEditors  : Vi卡农
 * @LastEditTime : 2020-01-09 10:16:53
 * @describe: --
 -->
<template>
    <el-dialog
        title="提示"
        :visible.sync="dialogVisible"
        width="50%"
        :show-close="false"
        :close-on-click-modal="false"
        :before-close="beforeClose"
        :destroy-on-close="true"
        @open='dialogOpen'
    >
        <!-- <span>这是一段信息</span> -->
        <intentionleaseinfo v-if="formState" ref="intentionleaseinfo"></intentionleaseinfo>
        <intentionsellinfo v-else ref="intentionsellinfo"></intentionsellinfo>

        <span slot="footer" class="dialog-footer">
            <el-button @click="dialogVisible = false">取 消</el-button>
            <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
        </span>
    </el-dialog>
</template>

<script>
// import mixinViewModule from '@/mixins/view-module'
import intentionleaseinfo from "./intentionleaseinfo-add-or-update";
import intentionsellinfo from "./intentionsellinfo-add-or-update";
export default {
    // mixins: [mixinViewModule],
    data() {
        return {
            dialogVisible: false,
            customerId: this.$route.query.ID,
            customerType: this.$route.query.customerType,
            mixinViewModuleOptions: {
                getDataListURL: "/intention/intentioninfo/page",
                getDataListIsPage: true,
                exportURL: "/intention/intentioninfo/export",
                deleteURL: "/intention/intentioninfo",
                deleteIsBatch: true
            },
            formState: null,
            dataForm: {
                id: ""
            }
        };
    },
    created() {
        if (
            this.customerType == "1" ||
            this.customerType == "3" ||
            this.customerType == "5"
        ) {
            //租
            this.formState = true;
            // this.$refs.intentionleaseinfo.init();
        } else if (
            this.customerType == "2" ||
            this.customerType == "4" ||
            this.customerType == "6"
        ) {
            //买
            this.formState = false;
            // this.$refs.intentionsellinfo.init();
        }
    },
    components: {
        intentionleaseinfo,
        intentionsellinfo
    },
    methods: {
        init() {
            this.dialogVisible = true;
        },
        dialogOpen(){
            
        },
        beforeClose(done) {
            this.$confirm("确认取消？")
                .then(_ => {
                    done();
                })
                .catch(_ => {});
        }
    }
};
</script>
